/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author ellha440
 */
class Inter {


    static String printOut(String name, String lang){
        def m = Language.findByMsgIDAndLanguage(name,lang)
        if(m){
            return m.msg
        }
        else{
            return("Can't translate: " + name + ", " + lang)
        }

    }

    static String splitParam(String param){
        param = param.substring(1,param.length()-1)
        String[] str=param.split(":")
        if(str.length>1){
            return str[1]
        }
        else{
            return ""
        }
    }


 static String outSplit(String ur,String sort){
       String[] str=ur.split("/")
       String out=null

       if(sort.equals("cont")){
           if(str.length>2){
               return str[2]
           }
             else{
               return out
           }
       }
        else if(sort.equals("vie")){
           if(str.length>3){
               return str[3]
           }
             else{
               return out
           }
       }
       else if(sort.equals("proID")){
           if(str.length>4){
               return str[4]
           }
           else{
              return out
           }
       }
       return out
   }
}

